home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c
- Subject: Re: Help: need to read a file name from a file and pass to func. to open another file
- Date: 7 Feb 1996 07:56 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <7FEB199607563377@erich.triumf.ca>
- References: <4f9o94$s5v@news.microsoft.com>
- NNTP-Posting-Host: erich.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <4f9o94$s5v@news.microsoft.com>, jparker@wolfenet.com (J Parker) writes...
- >Need help:
- >
- >I know what your thinking but I'm really an operator not a developer, and
- >I work grave so no around here at the time programs anything but maybe
- >VB (uhgg.. ;-) ).
- >
- >I'm trying to read a file full of file names, extract each name, pass one
- >name at a time to a function which opens the file and extracts info.
- >Both files are ascii. In the first part, I read the file and put the
- >file names into a 2 dimension character array. I then call the function,
- >passing one row at a time in a loop till all the files have been read.
- >
- >The problem is that when I pass what has now effectively become a char
- >string to the function, fopen() blows chunks on the "\0" character that C
- >places at the endof all char strings. (I've deduced this from debugging
- >code placed in the source, I may be way off here, comments ...)
-
- fopen() _requires_ the '\0' character at the end of the string - that is how C
- functions know where the end of the string is! Perhaps some real code, and an
- indication of the actual error, would help us provide a useful remedy to your
- problem.
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
-
-
-
-
-
-
-
-
-
-
-
-
-
-